package com.yyc.system.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.yyc.core.Mapper;
import com.yyc.system.model.TCourseClassTeacher;

public interface TCourseClassTeacherMapper extends Mapper<TCourseClassTeacher> {

	@Select("SELECT a.*,b.user_name FROM t_course_class_teacher a JOIN t_user b ON a.user_id = b.id")
	List<TCourseClassTeacher> getCourseMessage();

	@Select("SELECT b.*,c.user_name FROM t_course_user a, t_course_class_teacher b,t_user c WHERE a.course_id = b.id AND a.class_id = #{classId} AND b.user_id = c.id "
			+ "UNION SELECT b.*,c.user_name FROM t_course_user a, t_course_class_teacher b,t_user c WHERE a.course_id = b.id AND a.user_id = #{userId} AND b.user_id = c.id")
	List<TCourseClassTeacher> getCourseMessageByUIdCId(@Param("classId") Integer classId,@Param("userId") Integer userId);
}